﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Offers.aspx.cs" Inherits="TourAgency.Offers" %>

<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 53%;
        }
        .style2
        {
            width: 163px;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="sm" runat="server">
    </asp:ScriptManager>
    <asp:Label runat="server" ID="labelPageInfo">
        Here is a list of all offers from the tour agency</asp:Label>
    <asp:UpdatePanel ID="leftUpdatePanel" runat="server">
        <ContentTemplate>
            <asp:Panel ID="leftPanel" runat="server">
                <asp:GridView ID="gridViewTourOffers" runat="server" AutoGenerateColumns="False"
                    CellPadding="4" ForeColor="#333333" GridLines="None">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Destination
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# GetDestinationByID("DestinationID") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Start Date
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# GetDateOnly("StartDate")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                End Date
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# GetDateOnly("EndDate")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Price per person
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("Price") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Button ID="detailsButton" runat="server" Text="View Details" CommandArgument='<%# Eval("ID") %>'
                                    OnCommand="ShowDetails" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Button ID="reservationButton" runat="server" Text="Make Reservation" CommandArgument='<%# Eval("ID") %>'
                                    OnCommand="MakeReservation" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
                <br />
                <asp:Panel runat="server" ID="panelEnterPeopleInfo" >
                    <asp:Table runat="server" ID="tablePersonInformation" Visible="false">
                        <asp:TableRow>
                            <asp:TableCell>First Name</asp:TableCell>
                            <asp:TableCell>
                                <asp:TextBox ID="textBoxFirstName" runat="server"></asp:TextBox>
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>Last Name</asp:TableCell>
                            <asp:TableCell>
                                <asp:TextBox ID="textBoxLastName" runat="server"></asp:TextBox>
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>Passport</asp:TableCell>
                            <asp:TableCell>
                                <asp:TextBox ID="textBoxPassport" runat="server"></asp:TextBox>
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell ColumnSpan="2">
                                <asp:Button ID="buttonAddPerson" runat="server" Text="Add" OnClick="AddPersonToList" />
                            </asp:TableCell>
                        </asp:TableRow>
                    </asp:Table>
                    <asp:TextBox runat="server" ID="textBoxNotes" TextMode="MultiLine" 
                        Height="56px" Width="190px" Visible="false" Text="Enter notes here"></asp:TextBox>
                    <br />
                    <asp:Label runat="server" ID="labelTotalPrice" Text="Current price: 0.00" Visible="false"></asp:Label>
                    <br />
                    <asp:Button runat="server" ID="buttonConfirmReservation" Text="Confirm" OnClick="ConfirmReservation"
                       Visible="false"  />
                </asp:Panel>
                <asp:Panel runat="server" ID="panelShowCurrentPeople">
                    <asp:GridView runat="server" ID="gridViewAddedPeople" AutoGenerateColumns="false"
                        Visible="false">
                        <Columns>
                            <asp:TemplateField HeaderText="First Name">
                                <ItemTemplate>
                                    <asp:Label ID="labelFirstName" runat="server" Text='<%# Eval("First Name") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Last Name">
                                <ItemTemplate>
                                    <asp:Label ID="labelLastName" runat="server" Text='<%# Eval("Last Name") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Passport">
                                <ItemTemplate>
                                    <asp:Label ID="labelPassport" runat="server" Text='<%# Eval("Passport") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button runat="server" ID="buttonRemovePerson" Text="Remove" OnClick="RemovePerson" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </asp:Panel>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="rightUpdatePanel" runat="server">
        <ContentTemplate>
            <asp:Panel ID="rightPanel" runat="server">
                <h3>
                    Tour Details</h3>
                <hr />
                <asp:ListView ID="listViewDetails" runat="server">
                    <LayoutTemplate>
                        <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <div id="detailsViewItemTemplate">
                            <h4>
                                <%# GetDestinationByID("DestinationID")%></h4>
                            Price:
                            <%# Eval("Price", "{0:c}") %><br />
                            Start Date:
                            <%# GetDateOnly("StartDate") %><br />
                            End Date:
                            <%# GetDateOnly("EndDate") %><br />
                            <div id="description">
                                Description:
                                <%# EncodeEval("Description") %><br />
                            </div>
                            Transport:
                            <%# GetTransportnByID("TransportID")%><br />
                            Transport:
                            <%# GetBoardByID("BoardID")%><br />
                        </div>
                    </ItemTemplate>
                </asp:ListView>
                <div id="hotelFacs">
                    <asp:ListView ID="listViewHotelFacilities" runat="server">
                        <LayoutTemplate>
                            <div id="hotelFacilities">
                                <h4>
                                    Hotel Extras:</h4>
                                <ul>
                                    <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                                </ul>
                            </div>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <li>
                                <%# EncodeEval("Name") %></li>
                        </ItemTemplate>
                    </asp:ListView>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
